package com.wushijia.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "girl")
@Data
@EqualsAndHashCode(exclude = {"id"})  //复写equals和HashCode方法，并排除id属性
@ToString(callSuper = false,exclude = "id")
public class Girl {
  @Id
  @GenericGenerator(name = "uuid",strategy = "uuid")
  @GeneratedValue(generator = "uuid")
  @NonNull
  private String id;

  @NonNull
  private String name;

  @NonNull
  private int age;

}
